import { kgjHttp as http } from '@/services/http';
import type { ListResult, Limit } from '@/types/api/common';
import type { ColonelAllListParamsDTO, ColonelListParamsDTO, ColonelAddParamsDTO, ColonelEditParamsDTO, ColonelRechargeParamsDTO,
  ColonelAdjustParamsDTO, ColonelLogListParamsDTO, ColonelRewardsParamsDTO, ColonelSendCodeParamsDTO,
  ColonelUserListParamsDTO, ColonelUserRemarkParamsDTO } from '@/types/api/crm-agency/colonel';
// 全部代理列表（考古加+大赢加）
export const getColonelAllList = (payload: { data: ColonelAllListParamsDTO; params: Limit }) =>
  http<any>({
    method: 'post',
    url: '/api/colonel/alllist',
    ...payload
  });
// 代理列表
export const getColonelList = (payload: { data: ColonelListParamsDTO; params: Limit }) =>
  http<any>({
    method: 'post',
    url: '/api/colonel/list',
    ...payload
  });

// 新增代理
export const colonelAdd = (data: ColonelAddParamsDTO) =>
  http({
    method: 'post',
    url: '/api/colonel/add',
    data
  });

// 编辑代理
export const colonelEdit = (data: ColonelEditParamsDTO) =>
  http({
    method: 'post',
    url: '/api/colonel/edit',
    data
  });

// 客户列表
export const getColonelUserlist = (payload: { data: ColonelUserListParamsDTO; params: Limit }) =>
  http<ListResult<any>>({
    method: 'post',
    url: '/api/colonel/userlist',
    ...payload
  });
// 客户列表-备注修改
export const colonelRemark = (data:ColonelUserRemarkParamsDTO) =>
  http({
    method: 'post',
    url: '/api/colonel/remark',
    data
  });
// 获取操作日志列表
export const getColonelLogList = (payload: { data: ColonelLogListParamsDTO; params: Limit }) =>
  http({
    method: 'get',
    url: '/api/colonel/log/list',
    params: {
      ...payload.data,
      ...payload.params
    }
  });
// 调整保证金
export const colonelAdjust = (data: ColonelAdjustParamsDTO) =>
  http({
    method: 'post',
    url: '/api/colonel/adjust',
    data
  });
// 赠送奖励金
export const colonelSend = (data: ColonelRewardsParamsDTO) =>
  http({
    method: 'post',
    url: '/api/colonel/send',
    data
  });
// 赠送兑换码
export const colonelGencode = (data: ColonelSendCodeParamsDTO) =>
  http({
    method: 'post',
    url: '/api/colonel/gencode',
    data
  });

// 充值记录
export const colonelTopupList = (payload: { data: ColonelLogListParamsDTO; params: Limit }) =>
  http({
    method: 'post',
    url: '/api/colonel/topup/list',
    ...payload
  });

// 对公充值
export const colonelTopup = (data: ColonelRechargeParamsDTO) =>
  http({
    method: 'post',
    url: '/api/colonel/topup',
    data
  });
